#ifndef COMMSDEFS_H
#define	COMMSDEFS_H

#define COMMSMSGSIZE 9
#define MAXDATASIZE 6

//PIC msg types
#define ULTRASONIC 0x01
#define COLOR 0x02
#define ENCODER 0x3
#define MOTORCONTROLLER 0x04
#define DATAMANAGER 0x05


//ARM msg types
typedef enum __Msg_Type_Enum
{
Collision,
Mapping,
Speed,
Web,
DataManager,
Command
} Msg_Type_Enum;

typedef enum __Collision_Data_Enum
{TurnLeft,
SlightLeft,
Straight,
SlightRight,
TurnRight,
Stop,
Reverse
} Collision_Data_Enum;

//typedef enum __Mapping_Data_Enum
//{
//Far,
//Close,
//Here
//} Mapping_Data_Enum;

typedef enum __Speed_Data_Enum
{
Low,
High,
Finish,
None
} Speed_Data_Enum;

typedef enum __Web_Data_Enum
{
wStart,
wStop,
wMap
} Web_Data_Enum;

typedef enum __Motor_Controller_Commands_Enum
{cmdTurnLeft,
cmdSlightLeft,
cmdStraight,
cmdSlightRight,
cmdTurnRight,
cmdStop,
cmdReverse
} Motor_Controller_Commands_Enum;

#define ULTRASONIC_SLAVE_ADDR 0x44
#define COLOR_SLAVE_ADDR 0x46
#define ENCODER_SLAVE_ADDR 0x48

typedef struct __Comms_Msg_Struct
{
    unsigned char msgType;
    unsigned char counter;
    unsigned char size;
    unsigned char data[MAXDATASIZE];
} Comms_Msg_Struct;

typedef union __Comms_Msg_Union
{
    unsigned char msgData[COMMSMSGSIZE];
    Comms_Msg_Struct commsMsg;
} Comms_Msg_Union;

#endif	/* COMMSDEFS_H */

